<template>
  <div id="nav">
    <router-link custom to="/" v-slot="{navigate,isActive,isExactActive}">
       <span @click="navigate" :class="{active:isExactActive}">home</span>
    </router-link> |
    <router-link to="/a" custom v-slot="{navigate,isActive,isExactActive}">
      <span  @click="navigate" :class="{active:isExactActive}">about</span>
    </router-link> |
    <router-link to="/b" custom v-slot="{navigate,isActive,isExactActive}">
        <span  @click="navigate" :class="{active:isExactActive}">second</span>
    </router-link> |
  </div>
  <router-view/>
</template>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.active{
  color: red!important;
}
#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
